<?php

namespace app\api\controller\cms;

use app\api\service\ArticleService;
use app\api\validate\cms\ArticleValidate;
use app\api\controller\ApiController;
use think\response\Json;

class Article extends ApiController
{

    /**
     * 查看文章列表
     * @return Json
     */
    public function lists()
    {
        return $this->data(ArticleService::getList());
    }

    /**
     * 文章详情
     * @return Json
     */
    public function detail()
    {
        $params = (new ArticleValidate())->checkParam('detail');
        $result = ArticleService::detail($params, true);
        return $this->data($result);
    }

}